from typing import Annotated

from fastapi import APIRouter, Depends

from db.roles import get_all_roles
from db.db import AsyncSession, get_session
from routers.users import oauth2_scheme

roles_router = APIRouter()


@roles_router.get("/")
async def get_roles(
    token: Annotated[str, Depends(oauth2_scheme)],
    session: AsyncSession = Depends(get_session),
):
    """Возвращает список ролей."""
    return await get_all_roles(session=session)
